//
//  SearchModelSecond.m
//  XYFMApp
//
//  Created by 岁变 on 16/9/12.
//  Copyright © 2016年 岁变. All rights reserved.
//

#import "SearchModelSecond.h"
#import "XYMacro.h"

@implementation SearchModelSecond

- (void)setValue:(id)value forKey:(NSString *)key {
    
    if ([key isEqualToString:@"status"]) {
        _status = [SearchModelSecondStatus modelWithDictionary:value];
    }
    if ([key isEqualToString:@"data"]) {
        NSMutableArray *mArr = [NSMutableArray array];
        
        if ([value isKindOfClass:[NSArray class]]) {
            for (NSDictionary *dic in value) {
                
                SearchModelSecondData *model = [SearchModelSecondData modelWithDictionary:dic];
                [mArr addObject:model];
            }
            _data = mArr;
        } else {
            _data = mArr;
        }
    }
    if ([key isEqualToString:@"paginated"]) {
        _paginated = [SearchModelSecondPaginated modelWithDictionary:value];
    }
}


@end
